package cn.cy.behavior.mediator.pattern;

/**
 * @author yangxq
 * @desc
 * @date 2025-05-10
 */
public class User extends Colleague {

    private String name;

    public User(String name, Mediator mediator) {
        super(mediator);
        this.name = name;
    }

    @Override
    public void send(String message) {
        System.out.println(this.name + " sends message: " + message);
        mediator.notify(message, this);
    }

    @Override
    public void receive(String message) {
        System.out.println(this.name + " received message: " + message);
    }

}
